const util = require('../../utils/util.js');
const {$Message} = require('../asserts/iview/base/index');
Page({
  onLoad: ()=>{
    wx.showLoading({
      title: '加载中',
      mask: true
    });
  },
  onReady: ()=>{
    wx.hideLoading({});
  },
  editValue: (event)=>{
    let dataType = util.getEleAttribute('type', event);
    let editText = '';
    let index = 0;
    switch(dataType) {
      case 'area':
        editText = '地点';
        break;
      case 'cuisine':
        editText = '菜式';
        index = 2;
        break;
      case 'taste':
        editText = '口味';
        index = 3;
        break;
      default:
        break;
    }
    wx.navigateTo({
      url: '../edit/edit?editText='+editText+'&index='+index+'&key='+dataType
    });
  },
  draw: ()=>{

  },
  cleanData: ()=>{
    wx.removeStorageSync('area');
    wx.removeStorageSync('cuisine');
    wx.removeStorageSync('taste');
    $Message({
      content: '清空成功'
    });
  }
})